package com.s63.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class AjaxResult {
    private int code = 200;
    private String msg;
    private Object data;

    public static AjaxResult ok() {
        return new AjaxResult();
    }

    public static AjaxResult ok(Object data) {
        return new AjaxResult(200, "success", data);
    }

    public static AjaxResult err(String msg) {
        return new AjaxResult(500, msg, null);
    }

    public static AjaxResult err(int code, String msg) {
        return new AjaxResult(code, msg, null);
    }
}
